package com.le.tester.javaThink.fifth.chapter13_FuncProgramming;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;

/**
 * createTime：2021/8/6 15:31
 * description：不使用final的list,无法编译通过
 */
public class Closure9 {
    Supplier<List<Integer>> makeFun() {
        List<Integer> ai = new ArrayList<>();
        //再次指向新的地址
        ai = new ArrayList<>();
        //return () -> ai;
        return ArrayList::new;
    }
}
